using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Reflection;

namespace BuilderPattern
{
    class PersonDirector
    {
        PersonBuilder p;
        public PersonDirector(string type, Graphics g, Pen p)
        {
            object[] args = new object[2];
            args[0] = g;
            args[1] = p;
            this.p = (PersonBuilder)Assembly.Load("BuilderPattern").CreateInstance("BuilderPattern.Person" + type,false, BindingFlags.Default,null,args,null,null);
        }

        public void CreatePerson()
        {
            p.BuildHead();
            p.BuildBody();
            p.BuildArmLeft();
            p.BuildArmRight();
            p.BuildLegLeft();
            p.BuildLegRight();
        }
    }
}
